package com.ayn.aynsystem.utils;

public class regexpUtils {

    public static Boolean regexp(String var,String regexp){
        return  var.matches(regexp);
    }

    public static void main(String[] args) {
//        String var = "2022-05-24 11:34:01";
////        String regexp =  "^((((13[0-9]{1})|(14[5-8]{1})|(15((?!4)[0-9]){1})" +
////                "|(16[2,5,6,7]{1})|(17((?!4|9)[0-9]){1})|(19((?!4)[0-9]){1})|" +
////                "(18[0-9]{1}))+\\d{8})$" + "|([0][1-9]{2,3}[0-9]{5,10})$" + "|([0][1-9]{2,3}-[0-9]{5,10}))$";
//
////        String regexp = "((0\\\\d{2,3}-\\\\d{7,8})|(1[3584]\\\\d{9}))";
////        String regexp = "/^((0\\\\d{2,3}-\\\\d{7,8})|(1[3584]\\\\d{9}))$/";
//        String regexp = "^[0-9]{4}-(((0[13578]|(10|12))-(0[1-9]|[1-2][0-9]|3[0-1]))|(02-(0[1-9]|[1-2][0-9]))|((0[469]|11)-(0[1-9]|[1-2][0-9]|30)))\\s+([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$";
//        System.out.println(regexp(var,regexp));
//
//
//        String a = "";
//        a.equals("");
//        System.out.println(a);


        String s  ="1500";
        String str = s.replaceAll("([\\w\\W]*)([\\w\\W]{4})", "$1****");
        System.out.println(str);
    }
}
